//
//  SFNetworkTests.m
//  SFNetworkTests
//
//  Created by huang on 2019/1/23.
//  Copyright © 2019年 silverfruity. All rights reserved.
//

#import <XCTest/XCTest.h>
#import <SFNetwork/SFNetwork.h>
@interface SFNetworkTests : XCTestCase
@property (nonatomic, strong)HTTPClient *client;
@end

@implementation SFNetworkTests

- (void)setUp {
    self.client = [[HTTPClient alloc] initWithBaseUrl:[NSURL URLWithString:@"https://wwww.google.com"]];
}

- (void)tearDown {
    // Put teardown code here. This method is called after the invocation of each test method in the class.
}

- (void)testExample {
    HTTPPlugin *testPlugin = [HTTPPlugin new];
    HTTPPlugin *activityPlugin = [HTTPPlugin new];
    HTTPPlugin *serilaztionPlugin = [HTTPPlugin new];
    HTTPPlugin *reponseCheckPlugin = [HTTPPlugin new];
    HTTPPlugin *mapModelPlugin = [HTTPPlugin new];
    HTTPPlugin *blankPlaceholderPlugin = [HTTPPlugin new];
    
    testPlugin
    .addNext(activityPlugin)
    .addNext(serilaztionPlugin)
    .addNext(reponseCheckPlugin)
    .addNext(mapModelPlugin)
    .addNext(blankPlaceholderPlugin);
    
    [self.client requestWithMethod:GET uri:@"/normalTest" parameters:nil plugin:testPlugin completion:^(NSHTTPURLResponse * _Nonnull response, id  _Nullable data, NSError * _Nullable error) {
        
    }];
}

- (void)testPerformanceExample {
    // This is an example of a performance test case.
    [self measureBlock:^{
        // Put the code you want to measure the time of here.
    }];
}

@end
